package api.sea;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import conf.Url;
import util.HttpClientUtils;
import util.ResponseData;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class DelegationApi {
    private static final String delegation_url= Url.Base_Url+ "consumer/lgsEntrustment/add";
    public static ResponseData delegation(String truckCompanyCode, String truckCompany, String  cabinetNumber, int addressBook,
                                          String fbaCode,JSONArray cartonSizeList, String shippingDate,
                                          String startPort, String arrivePort, String tradeName, String deliveryDate,
                                          String transportWay, String customerOrderNumber, String isTax, String transportNumber,
                                          String transportCost, String isPasteList, String isPalletize, String trayLength,
                                          String trayWidth, String trayHeight, String sendPalletsNumber, int totalCartons,
                                          int totalGrossWeight, int totalVolume, String company, String recipients,
                                          String country, String addressOne, String addressTwo, String zipCode, String phone, String mark,
                                          String deliveryExplain, String palletizeType, String storeNumber, String warehouse, String containerWay,
                                          String  addressType, int markType, String salesmanName, String salesmanId,
                                          String operatorId, String operatorName, String foreignOperatorId,
                                          String foreignOperatorName, String customerName, String customerCode, int kukaiType
                                     ) throws IOException, URISyntaxException {
        Map<String, Object> data = new HashMap<>();
        data.put("truckCompanyCode",truckCompanyCode);
        data.put("truckCompany",truckCompany);
        data.put("cabinetNumber",cabinetNumber);
        data.put("addressBook",addressBook);
        data.put("fbaCode",fbaCode);
        data.put("cartonSizeList",cartonSizeList);
        data.put("shippingDate",shippingDate);
        data.put("startPort",startPort);
        data.put("arrivePort",arrivePort);
        data.put("tradeName",tradeName);
        data.put("deliveryDate",deliveryDate);
        data.put("transportWay",transportWay);
        data.put("customerOrderNumber",customerOrderNumber);
        data.put("isTax",isTax);
        data.put("transportNumber)",transportNumber);
        data.put("transportCost",transportCost);
        data.put("isPasteList",isPasteList);
        data.put("isPalletize",isPalletize);
        data.put("trayLength",trayLength);
        data.put("trayWidth",trayWidth);
        data.put("trayHeight",trayHeight);
        data.put("sendPalletsNumber",sendPalletsNumber);
        data.put("totalCartons",totalCartons);
        data.put("totalGrossWeight",totalGrossWeight);
        data.put("totalVolume",totalVolume);
        data.put("company",company);
        data.put("recipients",recipients);
        data.put("country",country);
        data.put("addressOne",addressOne);
        data.put("addressTwo",addressTwo);
        data.put("zipCode",zipCode);
        data.put("phone",phone);
        data.put("mark",mark);
        data.put("deliveryExplain",deliveryExplain);
        data.put("palletizeType",palletizeType);
        data.put("storeNumber",storeNumber);
        data.put("warehouse",warehouse);
        data.put("containerWay",containerWay);
        data.put("addressType",addressType);
        data.put("markType",markType);
        data.put("salesmanName",salesmanName);
        data.put("salesmanId",salesmanId);
        data.put("operatorId",operatorId);
        data.put("operatorName",operatorName);
        data.put("foreignOperatorId",foreignOperatorId);
        data.put("foreignOperatorName",foreignOperatorName);
        data.put("customerName",customerName);
        data.put("customerCode",customerCode);
        data.put("kukaiType",kukaiType);
        System.out.println(data);
        return HttpClientUtils.post_json(delegation_url,data);
    }
}
